using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OA.Common
{
    public class Keys
    {
        /// <summary>
        /// Hnibernate 当前的 context.items 存储key
        /// </summary>
        public const string NhibernateCurrentSessionKey = "nhibernate.current_session";

        /// <summary>
        /// Hnibernate 当前的 context.items 存储key
        /// </summary>
        public const string NhibernateTiptopCurrentSessionKey = "nhibernate.tiptop_current_session";

        /// <summary>
        /// 即时通讯消息缓存前缀
        /// </summary>
        public const string ChatCachePrefix = "ChatCachePrefix";

        public const string session_param_name = "ASPSESSID";
        public const string session_cookie_name = "ASP.NET_SessionId";

        /// <summary>
        /// 保存到session中的当前用户key
        /// </summary>
        public const string SessionLoginManager = "LoginManager";

        /// <summary>
        /// 保存到cookies中的用户名key
        /// </summary>
        public const string CookieLoginUserName = "LoginUserName";


        /// <summary>
        /// 保存到cookies中的密码 key
        /// </summary>
        public const string CookieLoginPassword = "LoginPassword";


        /// <summary>
        /// 系统配置
        /// </summary>
        public const string CacheSystemConfig = "cachesystemconfig";


        /// <summary>
        /// 系统设置配置文件地址
        /// </summary>
        public const string SystemConfigXMLPath = "~/Content/Config/SystemConfig.xml";

        /// <summary>
        /// 日期格式化
        /// </summary>
        public const string DATEFORMAT = "yyyy-MM-dd HH:mm:ss";

        /// <summary>
        /// 解析后的邮件内容key
        /// </summary>
        public const string MailTemplateBody = "MailTemplateBody";


        /// <summary>
        /// 解析后的邮件标题key
        /// </summary>
        public const string MailTemplateSubject = "MailTemplateSubject";

        /// <summary>
        /// 缓存hql的key
        /// </summary>
        public const string LogHqlKey = "loghql";

        public static string LogPath 
        {
            get 
            {
                var logPath = System.Configuration.ConfigurationManager.AppSettings["LogFilePath"];
                if (string.IsNullOrEmpty(logPath)) logPath = "Log";
                if (logPath.IndexOf(':') < 0) logPath = AppDomain.CurrentDomain.BaseDirectory + logPath;
                return logPath;
            }
        }

        public static string WebSiteCode = System.Configuration.ConfigurationManager.AppSettings["WebSiteCode"];
    }
}
